<?php


if($_POST){
    //连接数据库
	$server = 'localhost';
	$user = 'root';
	$psw = 'root';
	$db = 'qq';
	$conn = new PDO("mysql:host=$server;dbname=$db",$user,$psw);
    //把数据写入数据库保存
    $sql = "insert into user (id,username) values (NULL,'$_POST[username]')";
    $conn->exec($sql);
    header('Location:onload.php');
}

include 'friend.html';



